package Day017_缓冲流_转换流_序列化流_打印流.ZuoYe;

import java.io.FileInputStream;
import java.io.InputStreamReader;

/**
 * @author zhangyan
 * @date 2020/5/9 20:31
 */
public class Test8 {
    public static void main(String[] args) throws Exception{

        //创建转换流对象 指定编码
        FileInputStream fis = new FileInputStream("Demo02\\ccc\\a.txt");
        InputStreamReader isr = new InputStreamReader(fis,"GBK");

        // 定义变量,保存数据
        int read;
        //循环遍历
        while ((read = isr.read()) != -1) {
            System.out.print((char) read);
        }

        //关流
        isr.close();
    }
}
